#ifndef _MAINFORM_H_
#define _MAINFORM_H_

#include <FBase.h>
#include <FUi.h>
#include <FXml.h>
#include "MyDownloader.h"

class MainForm :
	public Osp::Ui::Controls::Form,
	public Osp::Ui::IActionEventListener,
	public Osp::Ui::ICustomItemEventListener
{

// Construction
public:
	MainForm(void);
	virtual ~MainForm(void);
	bool Initialize(void);

// Implementation
protected:
	static const int ID_EGY = 101;
	static const int ID_KETTO = 102;
	static const int ID_HAROM = 103;
	static const int ID_LISTA_ELEM = 104;

	Osp::Ui::Controls::ScrollPanel *__pScrollPanel1;
	Osp::Ui::Controls::ScrollPanel *__pScrollPanel2;
	Osp::Ui::Controls::ScrollPanel *__pScrollPanel3;
	Osp::Ui::Controls::CustomList *__pMyList;
	Osp::Ui::Controls::CustomListItemFormat *__pCustomListItemFormat;
	Osp::Ui::Controls::OptionMenu *__pOptionsMenu;

	Osp::Xml::xmlDoc * doc;
	Osp::Xml::xmlXPathContextPtr xpathContext;
	Osp::Xml::xmlXPathObjectPtr xpathObjEloado;
	Osp::Xml::xmlXPathObjectPtr xpathObjCim;

	MyDownloader mydownloader;

public:
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);

	void ParseAndWrite();

	void OnItemStateChanged(const Osp::Ui::Control& source, int index, int itemId, Osp::Ui::ItemStatus status);
	void OnItemStateChanged(const Osp::Ui::Control& source, int index, int itemId, int elementId, Osp::Ui::ItemStatus status);
};

#endif	//_MAINFORM_H_
